﻿using System;

namespace BizElements.Web
{
    /// <summary>Defines common URL query-string keys. Prefer using <see cref="WebFormContext"/> class which has a reacher set of functionalitiy 
    /// and may be adapted to use mechanisms other than query string. Eg: session state, POST variables etc.</summary>
    public static class CommonQueryKeys
    {
        #region Common query-string keys.

        /// <summary>ID (integer value) of the entity/business object handled/edited by the page. Key: <b>id</b></summary>
        public const string EntityId = "id";

        /// <summary>JavaScript code that is to be executed if business action was a success. Key: <b>onSuccess</b></summary>
        public const string OnSuccessScript = "onSuccess";

        /// <summary>JavaScript code that is to be executes if business action was canceled. Key: <b>onCancel</b></summary>
        public const string OnCancelScript = "onCancel";

        /// <summary>JavaScript code that is to be executed when the page is no longer needed. Key: <b>onClose</b></summary>
        public const string OnCloseScript = "onClose";

        /// <summary>URL to which the user is redirected when he is done working with the current page. Key: <b>onCloseUrl</b></summary>
        public const string OnCloseUrl = "onCloseUrl";

        /// <summary>Index of the tab page that was selected prior to redirection to another page. Key: <b>selectedTab</b></summary>
        public const string SelectedTab = "selectedTab";

        #endregion

        internal const string ReloadOpener = "ReloadOpener";
    }
}
